import BasicLayout from "../layouts/BasicLayout";
import {createRoutes} from "../utils/core";

import Login from './User/Login';
import FillLayout from "../layouts/FillLayout";
import Register from "./User/Register";
import GoodType from "./Good/GoodType";
import Goods from "./Good/Goods";
import OrderList from "./Order/OrderList";
import OrderDetail from "./Order/OrderDetail";
import UsrList from "./User/UsrList";
import SlideShow from "./Good/SlideShow"
import Shipper from "./Set/Shipper"
import MemberCard from './User/MemberCard';
import RewardRecord from './Promote/RewardRecord';
import Drp from './Promote/Drp';
import UserReward from './Finance/UserReward';
import Withdrawal from './Finance/Withdrawal';

import Seller from './Shop/Seller';

const routesConfig = (app) => ([

  {
    path: '/sign',
    title: '登录',
    indexRoute: '/sign/login',
    component: FillLayout,
    childRoutes: [
      Login(app),
      Register(app),
    ]
  },

  {
    path: '/detail',
    component: FillLayout,
    childRoutes: [
      OrderDetail(app),
    ]
  },

  {
    path: '/',
    title: '系统中心',
    component: BasicLayout,
    indexRoute: '/user',
    childRoutes: [
      UsrList(app),
      SlideShow(app),
      GoodType(app),
      Goods(app),
      OrderList(app),
      Shipper(app),
      MemberCard(app),
      RewardRecord(app),
      Drp(app),
      UserReward(app),
      Withdrawal(app),
      Seller(app),
    ],
  },

])


export default app => createRoutes(app, routesConfig);
